package web;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class Monitor
 */
public class Monitor extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Monitor() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Actions action = new Actions();
		
		if( request.getParameter("act").equals("cadastrar") ){
			PrintWriter out = response.getWriter();
			out.println("O EU AQUI");
			action.cadastrar();
			
		}
		if( request.getParameter("act").equals("alterar") ){
			PrintWriter out = response.getWriter();
			out.println("O EU AQUI");
			action.alterar();
		}
		if( request.getParameter("act").equals("excluir") ){
			PrintWriter out = response.getWriter();
			out.println("O EU AQUI");
			action.excluir();
		}
	}

}
